package Logic;

public class Point2d {
    public int x;
    public int y;

    public Point2d() {

    }

    public Point2d(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public Point2d Sub(Point2d rhd) {
        return new Point2d(x - rhd.x, y - rhd.y);
    }

    public Point2d Add(Point2d rhd) {
        return new Point2d(x + rhd.x, y + rhd.y);
    }

    public Point2d Mul(Point2d rhd) {
        return new Point2d(x + rhd.x, y + rhd.y);
    }

    public int Length() {
        return (int) Math.sqrt(x*x + y*y);
    }

    public int Length(Point2d point) {
        return (int) Math.sqrt(point.x * point.x + point.y * point.y);
    }
}
